<?php
session_start();
if($_SESSION['log']===false)

{session_destroy();
echo "<meta http-equiv='refresh' content='1;url=index.php'>";
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs"> 
<head>
 <link rel="stylesheet" type="text/css" href="css/css.css"/>  
 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
 <title>Administrace</title>
<style type="text/css">
   .modra{background-color:red;}
   .oranz{background-color:orange;}
   .ruz {background-color:pink;}
   .cer{color:red;}
   table,td{border:1px solid black;}
</style> 
</head>
<body>        
<div id="global"><!-- Začátek Global -->
<h2>BITWA Petr Šmíd</h2>
<div id="hlavicka"><!-- Začátek hlavičky -->
</div><!-- Konec hlavičky -->
<div id="menu1"><!-- Začátek menu -->
<div id="banner1">
<h2>Další stránky</h2>
</div>
</div>
<?
$con=mysql_connect("localhost", "smidpet5", "aez9okai");
// Check connection
if (!$con)
  {
  echo "Failed to connect to MySQL: " . mysql_connect_error();
  } 
mysql_select_db("smidpet5");    
$mm = mysql_query("SELECT * FROM `objednavka`", $con) ;    
 if (!$mm) {
		    echo "Chyba:".$current['id'];
		    return false;
			}
echo "<table>";echo "<tr>";echo "<th>";echo "Datum";echo "</th>";echo "<th>";echo "BMI";echo "</th>";echo "</tr>";
	 	
while ($current=mysql_fetch_array($mm, MYSQL_ASSOC)){ 
			echo "<tr>";
			echo "<td>";
			echo $current["jmeno"];
			echo "</td>";
			echo "<td>";
			echo $current["objem"];
			echo "</td>" ;
      echo "<td>";
			echo $current["dvere"];
			echo "</td>";
      echo "<td>";
			echo $current["barva"];
			echo "</td>";
      echo "<td>";
			echo $current["cena"];
			echo "</td>";
      echo "<td>";		      
			echo "</tr>";			
		} 
		
		echo "</table>";        
   


  ?>


</div> <!-- Konec Global -->
<div id="pata" style="text-align: center"> <!-- Začátek pata -->  
Úkol vypracoval: Petr Šmíd
</div><!-- Konec pata -->
</body>
</html>